import React from "react"
//url将地址栏中的查询字符串转为对象形式
import url from "url"
export default class DetailIndex extends React.Component {
    constructor() {
        super()
        this.state = {
            id:''
        }
    }
    componentWillMount(){
        // console.log(this.props)
        console.log(url.parse(this.props.location.search,true))
        this.setState({
            id:url.parse(this.props.location.search,true).query.id
        })
    }
    render() {
        return (
            <div>
                详情详情页{ this.state.id}
            </div>
        )
    }
}